package com.leakey.ddt;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
	public static void main(String[] args) {
		Pattern p = Pattern.compile("<[a-zA-Z]+:");
		String str1 = "\n<xref:prop-group name=\"ref-maps\">\n<xref:prop prop-type=\"gmap\">{i1=t1, i10=t6, i11=t6, i12=t7, i14=t8, i16=t9, i17=t9, i18=t9, i2=t2, i24=t11, i27=t16, i3=t3, i30=t17, i32=t19, i33=t19, i34=t19, i38=t20, i4=t4, i6=t5, i7=t5}</xref:prop>"
				+ "<xref:prop prop-type=\"xmap\">{x1=t9, x12=t15, x14=t16, x15=t16, x2=t9, x20=t17, x22=t18, x24=t19, x25=t19, x8=t11}</xref:prop>"
				+ "</xref:prop-group><note >test</note>";
		String str2 = "<xref:";
		String str3 = "<xref:prop-group name=\"ref-maps\">";
		Matcher m = p.matcher(str1);
		boolean foundMatch = m.matches();
//		if (foundMatch) {
//			System.out.println("str1 matches result:" + m.group());
//		} else {
//			System.out.println("str1 matches result:false");
//		}
//
//		foundMatch = m.lookingAt();
//		if (foundMatch) {
//			System.out.println("str1 lookingAt result:" + m.group());
//		} else {
//			System.out.println("str1 lookingAt result:false");
//		}
//
//		foundMatch = m.find(0);
//		if (foundMatch) {
//			System.out.println("str1 find result:" + m.group());
//		} else {
//			System.out.println("str1 find result:false");
//		}
//
//		m = p.matcher(str2);
//		foundMatch = m.matches();
//		if (foundMatch) {
//			System.out.println("str2 matches result:" + m.group());
//		} else {
//			System.out.println("str2 matches result:false");
//		}
//
//		foundMatch = m.lookingAt();
//		if (foundMatch) {
//			System.out.println("str2 lookingAt result:" + m.group());
//		} else {
//			System.out.println("str2 lookingAt result:false");
//		}
//
//		foundMatch = m.find(0);
//		if (foundMatch) {
//			System.out.println("str2 find result:" + m.group());
//		} else {
//			System.out.println("str2 find result:false");
//		}
//
		m = p.matcher(str3);
		foundMatch = m.matches();
		if (foundMatch) {
			System.out.println("str3 matches result:" + m.group());
		} else {
			System.out.println("str3 matches result:false");
		}

		foundMatch = m.lookingAt();
		if (foundMatch) {
			System.out.println("str3 lookingAt result:" + m.group());
		} else {
			System.out.println("str3 lookingAt result:false");
		}

		foundMatch = m.find(0);
		if (foundMatch) {
			System.out.println("str3 find result:" + m.group());
		} else {
			System.out.println("str3 find result:false");
		}
	}
}
